package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.domain.DestinationTemplate;
import cn.wolfcode.luowowo.search.repository.DestinationSearchRepository;
import cn.wolfcode.luowowo.search.service.IDestinationSearchService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

@Service
public class DestinationSearchServiceImpl implements IDestinationSearchService{

    @Autowired
    private DestinationSearchRepository repository;

    @Autowired
    private ElasticsearchTemplate template;

    @Override
    public void saveOrUpdate(DestinationTemplate template) {

        repository.save(template);
    }

    @Override
    public DestinationTemplate getDestByName(String name) {
        return repository.findByName(name);
    }
}
